<?php

use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;

return [

    /*
    |--------------------------------------------------------------------------
    | Default Log Channel
    |--------------------------------------------------------------------------
    |
    | This option defines the default log channel that gets used when writing
    | messages to the logs. The name specified in this option should match
    | one of the channels defined in the "channels" configuration array.
    |
    */

    'default' => env('LOG_CHANNEL', 'stack'),

    /*
    |--------------------------------------------------------------------------
    | Log Channels
    |--------------------------------------------------------------------------
    |
    | Here you may configure the log channels for your application. Out of
    | the box, Laravel uses the Monolog PHP logging library. This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Drivers: "single", "daily", "slack", "syslog",
    |                    "errorlog", "monolog",
    |                    "custom", "stack"
    |
    */

    // 是否显示token
    'show_token' => env('LOG_SHOW_TOKEN', false),

    // cli 模式下是否记录日志
    'channel_sql_status' => env('LOG_SQL_STATUS', false),
    'channel_sql_record_when_cli' => env('LOG_SQL_RECORD_WHEN_CLI', false),

    'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily'],
            'ignore_exceptions' => false,
            'permission'=>0777,
        ],

        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'permission'=>0777,
        ],

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 90,
            'permission'=>0777,
        ],

        'slack' => [
            'driver' => 'slack',
            'url' => env('LOG_SLACK_WEBHOOK_URL'),
            'username' => 'Laravel Log',
            'emoji' => ':boom:',
            'level' => env('LOG_LEVEL', 'critical'),
            'permission'=>0777,
        ],

        'alipaylog' => [
            'driver' => 'daily',
            'path' => storage_path('alipaylog/alipay.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'otherlog' => [
            'driver' => 'daily',
            'path' => storage_path('otherlog/other.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'esign' => [
            'driver' => 'daily',
            'path' => storage_path('esign/esign.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'wechatlog' => [
            'driver' => 'daily',
            'path' => storage_path('wechatlog/wechatlog.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'antchain' => [
            'driver' => 'daily',
            'path' => storage_path('antchain/antchain.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'cron' => [
            'driver' => 'daily',
            'path' => storage_path('cron/run.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 1,
            'permission'=>0777,
        ],

        'baofuPaylog' => [
            'driver' => 'daily',
            'path' => storage_path('baofuPaylog/run.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 100,
            'permission'=>0777,
        ],


        'notarizelog' => [
        'driver' => 'daily',
        'path' => storage_path('notarizelog/notarizelog.log'),
        'level' => env('LOG_LEVEL', 'debug'),
        'days' => 9000,
        'permission'=>0777,
],
        'zlblog' => [
            'driver' => 'daily',
            'path' => storage_path('zlblog/zlblog.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'other' => [
            'driver' => 'daily',
            'path' => storage_path('other/callbacks.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],
        'risk' => [
            'driver' => 'daily',
            'path' => storage_path('risk/risk.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 9000,
            'permission'=>0777,
        ],

        'papertrail' => [
            'driver' => 'monolog',
            'level' => env('LOG_LEVEL', 'debug'),
            'handler' => SyslogUdpHandler::class,
            'handler_with' => [
                'host' => env('PAPERTRAIL_URL'),
                'port' => env('PAPERTRAIL_PORT'),
            ],
            'permission'=>0777,
        ],
        'stderr' => [
            'driver' => 'monolog',
            'handler' => StreamHandler::class,
            'formatter' => env('LOG_STDERR_FORMATTER'),
            'with' => [
                'stream' => 'php://stderr',
            ],
            'permission'=>0777,
        ],

        'syslog' => [
            'driver' => 'syslog',
            'level' => env('LOG_LEVEL', 'debug'),
            'permission'=>0777,
        ],

        'errorlog' => [
            'driver' => 'errorlog',
            'level' => env('LOG_LEVEL', 'debug'),
        ],

        'null' => [
            'driver' => 'monolog',
            'handler' => NullHandler::class,
        ],

        'emergency' => [
            'path' => storage_path('logs/laravel.log'),
            'permission'=>0777,
        ],
        'customerinfo' => [
            'driver' => 'daily',
            'path' => storage_path('customerinfo/customerinfo.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'days' => 90,
            'permission'=>0777,
        ],
        'general' => [
            'driver' => 'custom',
            'via' => \App\Logging\Logger\GeneralLogger::class,
            'path' => storage_path('logs/general/general.log'),
            'path_error' => storage_path('logs/error/error.log'), // 错误日志路径
            'path_mode' => env('LOG_GENERAL_PATH_MODE', \App\Logging\Service\LogGeneralService::PATH_MODE_API),
            // 这个参数定义了日志记录的最低级别。只有高于或等于这个级别的日志记录才会被写入到日志文件中
            // 从高到低：emergency、alert、critical、error、warning、notice、info、debug
            'level' => 'debug',
            'days' => 14,
            'processor' => [\App\Logging\Processor\GeneralProcessor::class],
        ],
        'cmd' => [
            'driver' => 'custom',
            'via' => \App\Logging\Logger\CmdLogger::class,
            'path' => storage_path('logs/cmd/cmd.log'),
            'path_error' => storage_path('logs/error/error.log'), // 错误日志路径
            'path_mode' => \App\Logging\Service\LogCmdService::PATH_MODE_CLASS, // 路径生产模式：general 通常，class 按命令类名
            'level' => 'debug',
            'days' => 14,
            'processor' => [\App\Logging\Processor\CmdProcessor::class],
        ],
        'job' => [
            'driver' => 'custom',
            'via' => \App\Logging\Logger\JobLogger::class,
            'path' => storage_path('logs/job/job.log'),
            'path_error' => storage_path('logs/error/error.log'), // 错误日志路径
            'path_mode' => \App\Logging\Service\LogJobService::PATH_MODE_CLASS, // 路径生产模式：general 通常，class 按命令类名
            'level' => 'debug',
            'days' => 14,
            'processor' => [\App\Logging\Processor\JobProcessor::class],
        ],
        'sql_json' => [
            'driver' => 'custom',
            'via' => \App\Logging\Logger\SqlJsonLogger::class,
            'path' => storage_path('logs/sql_json/sql_json.log'),
            'level' => 'debug',
            'days' => 14,
            'processor' => [\App\Logging\Processor\SqlJsonProcessor::class],
        ],
    ],

];
